/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package uy.edu.ort.as.cliente.igu;

import java.awt.event.KeyEvent;

/**
 *
 * @author victor
 */
public class JFramePrincipal extends javax.swing.JFrame {
    private String nombreUsuario = "admin";
    private String claveUsuario = "admin";
    /**
     * Creates new form JFramePrincipal
     */
    public JFramePrincipal() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        btnPaginasWeb = new javax.swing.JButton();
        btnEntradasBlog = new javax.swing.JButton();
        btnLogin = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setResizable(false);

        btnPaginasWeb.setText("Páginas Web");
        btnPaginasWeb.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnPaginasWebActionPerformed(evt);
            }
        });
        btnPaginasWeb.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                btnPaginasWebKeyReleased(evt);
            }
        });

        btnEntradasBlog.setText("Entradas de Blog");
        btnEntradasBlog.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnEntradasBlogActionPerformed(evt);
            }
        });
        btnEntradasBlog.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                btnEntradasBlogKeyReleased(evt);
            }
        });

        btnLogin.setText("Login");
        btnLogin.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnLoginActionPerformed(evt);
            }
        });
        btnLogin.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                btnLoginKeyReleased(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(21, 21, 21)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(btnLogin, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(btnEntradasBlog, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(btnPaginasWeb, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(19, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(18, 18, 18)
                .addComponent(btnEntradasBlog)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(btnPaginasWeb)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(btnLogin)
                .addContainerGap(20, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnLoginActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnLoginActionPerformed
        JFrameLogin jflogin = new JFrameLogin(this);
        jflogin.setVisible(true);
    }//GEN-LAST:event_btnLoginActionPerformed

    private void btnPaginasWebActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPaginasWebActionPerformed
        JFramePaginasWeb jfpw = new JFramePaginasWeb(this);
        jfpw.setVisible(true);
    }//GEN-LAST:event_btnPaginasWebActionPerformed

    private void btnEntradasBlogActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEntradasBlogActionPerformed
        JFrameEntradasBlog jfeb = new JFrameEntradasBlog(this);
        jfeb.setVisible(true);
    }//GEN-LAST:event_btnEntradasBlogActionPerformed

    private void btnEntradasBlogKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_btnEntradasBlogKeyReleased
        if (evt.getKeyCode() == KeyEvent.VK_DOWN) {
            btnPaginasWeb.requestFocusInWindow();
        }
    }//GEN-LAST:event_btnEntradasBlogKeyReleased

    private void btnPaginasWebKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_btnPaginasWebKeyReleased
        if (evt.getKeyCode() == KeyEvent.VK_DOWN) {
            btnLogin.requestFocusInWindow();
        } else if (evt.getKeyCode() == KeyEvent.VK_UP) {
            btnEntradasBlog.requestFocusInWindow();
        }
    }//GEN-LAST:event_btnPaginasWebKeyReleased

    private void btnLoginKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_btnLoginKeyReleased
        if (evt.getKeyCode() == KeyEvent.VK_UP) {
            btnPaginasWeb.requestFocusInWindow();
        }
    }//GEN-LAST:event_btnLoginKeyReleased

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnEntradasBlog;
    private javax.swing.JButton btnLogin;
    private javax.swing.JButton btnPaginasWeb;
    // End of variables declaration//GEN-END:variables

    public String getNombreUsuario() {
        return nombreUsuario;
    }

    public void setNombreUsuario(String nombreUsuario) {
        this.nombreUsuario = nombreUsuario;
    }

    public String getClaveUsuario() {
        return claveUsuario;
    }

    public void setClaveUsuario(String claveUsuario) {
        this.claveUsuario = claveUsuario;
    }
}
